/**
 * 
 */
package com.wskj.library.employer.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;
import com.wskj.library.service.EmployerService;
import com.wskj.library.service.impl.EmployerServiceImpl;
import com.wskj.util.StringUtil;

/**
 * @author 胡洋
 * @describe 
 * @Date 2018年3月23日下午7:19:05
 * @version 1.0
 */
@WebServlet("/employer/resetPass.do")
public class EmpResetPassServlet extends HttpServlet {
	EmployerService  emService=new EmployerServiceImpl(); 
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//进行  ajax 的修改密码 然后弹出提示的信息 是否重置成功.....
		int id =StringUtil.nullToInt(req.getParameter("id"));
		
		boolean result=emService.updatePassWord(id, "000000");
		
		String json = JSON.toJSONString(result);
		
		resp.setContentType("application/json;charset=utf-8");
		
		PrintWriter out = resp.getWriter();
		
		out.write(json);		
		out.close();		
	}

}
